package com.buildings.activity;

import android.os.Bundle;

import androidx.annotation.Nullable;

import com.buildings.R;
import com.buildings.base.BaseActivity;
import com.buildings.map.GoogleMapLayer;
import com.buildings.map.TianDiMapUtils;
import com.esri.arcgisruntime.geometry.Point;
import com.esri.arcgisruntime.geometry.SpatialReference;
import com.esri.arcgisruntime.layers.WebTiledLayer;
import com.esri.arcgisruntime.mapping.ArcGISMap;
import com.esri.arcgisruntime.mapping.Basemap;
import com.esri.arcgisruntime.mapping.view.MapView;

import butterknife.BindView;
import butterknife.ButterKnife;

public class GogleMapActivity extends BaseActivity {
    @BindView(R.id.mapview)
    MapView mapView;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_gogle_map);
        ButterKnife.bind(this);
        final WebTiledLayer webTiledLayer =
                TianDiMapUtils.getTianDiMap(TianDiMapUtils.MapType.URL_CN_GOOGLE_MAP);
        webTiledLayer.loadAsync();
        ArcGISMap map = new ArcGISMap(new Basemap(webTiledLayer));
        mapView.setMap(map);

    }

    @Override
    protected void onResume() {
        super.onResume();
        mapView.resume();
    }

    @Override
    protected void onPause() {
        super.onPause();
        mapView.pause();
    }
}
